class Frontend::ActivityController < ApplicationController
before_filter :login_required, :only => ["new","edit"]

  def index
    redirect_to_home
  end

  def new
    if current_student.nil?
      flash[:alert] = t"general.login.logintocontinue"
      redirect_to_home
    end
    @activity = StudentActivity.new()
    if request.post?
      @activity = params[:student_activity]
      @activity[:student_id] = current_student[:id]
      @activity = StudentActivity.new(@activity)
      if @activity.save
        flash[:notice] = t"activity.form.message.success"
      else
        flash[:alert] = t"activity.form.message.error"
      end
      redirect_to :root
    end
  end
  def edit
  end

end
